﻿@model MvcMate.Samples.Models.Helpers.UploadForInNestedViewModel.ChildViewModel

@{
    Html.ViewData.TemplateInfo.HtmlFieldPrefix = "Child";
}
<h1>Partial View with HTML Prefix</h1>

<h2>No Validation</h2>
@using (Html.BeginForm("Upload", "My", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <div class="editor-label">
        @Html.LabelFor(model => model.TheFile)
    </div>
    <div class="editor-field">
        @Html.UploadFor(model => model.TheFile)
    </div>
    <p>
        <input type="submit" value="Upload" />
    </p>
}

<h2>Validation</h2>
@using (Html.BeginForm("Upload", "My", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <div class="editor-label">
        @Html.LabelFor(model => model.TheRequiredFile)
    </div>
    <div class="editor-field">
        @Html.UploadFor(model => model.TheRequiredFile)
        @Html.ValidationMessageFor(model => model.TheRequiredFile)
    </div>
    <p>
        <input type="submit" value="Upload" />
    </p>
}
